package cn.tedu.spring.scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestDBConnect {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.scope");
        //第一次获取
        DBConnect dbConnect1=context.getBean(DBConnect.class);
        System.out.println("dbConnect1 = " + dbConnect1);
        //第二次获取
        DBConnect dbConnect2=context.getBean(DBConnect.class);
        System.out.println("dbConnect2 = " + dbConnect2);
    }
}
